#!/usr/bin/enr/python3
# -*- coding: utf-8 -*-
# -------------------------------
# @Author : hurong
# @File : day09_运算符优先级.py
# @Time : 2025/7/19 15:26
# -------------------------------

'''
1. 运算符的优先级别

'''
def priority():
    # 同级别：左结合性；算术运算符 ＞ 赋值运算符
    result = 1 + 2 + 3 + 4 + 5
    print(result)
    # 右结合性,依次向左运算
    a = b = c = d = 10
    print(a, b, c, d)

    # 改变优先级
    result1 = 1 + 2 * 3
    result2 = (1 + 2) * 3
    print(result1)
    print(result2)

    rel = 1 + 2 *5 > (0 and 6) < 10 or 3 < 1 and 7 + 2
    print(rel)

'''
总结：1. 改变优先级，用括号。
'''
priority()
